﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microhard.Permission.Interface;
using Microhard.WarehouseInsp.Buz.Impls;
using Microhard.WarehouseInsp.Buz.Models;
using Microhard.WarehouseInsp.Buz.Interfaces;
using Microhard.Core;
using Microsoft.Practices.Unity;
using Microhard.Permission.MVCFilter;
using Microhard.WebUI.Models;
using Microhard.WarehouseInsp.Buz.DataAccess;
using Telerik.Web.Mvc;
using Microhard.Core.DBUtility;
using Microhard.Permission.Models;

namespace Microhard.WarehouseInsp.WebUI.Areas.WarehouseInsp.Controllers
{
    /// <summary>
    /// 入库控制器
    /// </summary>
    public class OutIntPutWarehouseController : MicroHardBaseController<OutIntPutWarehouseModel>
    {

        private IOutIntPutWarehouse _ioutint = null;

        [Dependency]
        public IOutIntPutWarehouse Ioutint
        {
            set
            {
                base._repository = _ioutint = value;
            }
            get
            {
                return _ioutint;
            }

        }

        [MVCFilterAtrForLogon()]
        public ActionResult SelectPPInrec(AttributeOfWindow ctrAttr, ScopeResult scope)
        {
            return View("SelectProducts", ctrAttr);
        }
        [MVCFilterAtrForLogon()]
        public ActionResult _ListSelectPPInrec(PledgePlanInRecordsModel model, ScopeResult scope)
        {
            IPledgePlanInRecords ippir = IoC.Resolve<IPledgePlanInRecords>();
            ippir.scope = scope;
            var data = ippir.GetPlanPlgsByUserID(model);
            var userModel = new GridModel()
            {
                Data = data
            };
            return new JsonResult
            {
                Data = userModel
            };
        }

    }
}
